home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
cmouse.zip
/
GMOUSCUR.I
< prev
next >
Wrap
Text File
|
1987-12-25
|
4KB
|
103 lines
/* GMOUSCUR.I is an #include file defining several graphics mouse */
/* cursor patterns. All are statics. */
/* This file also contains an event handler called by the mouse */
/* device driver, and a global event record variable 'theEvents' */
/* Must #include MOUSE.I above this #include file. */
/* --------------------------------------------------------------- */
typedef struct { /* mouse event record */
unsigned flag, button, col, row;
} EVENTREC;
typedef struct { /* graphics cursor descriptor */
unsigned *image;
unsigned hotX, hotY;
} GCURSREC;
/* check mark image */
static unsigned checkIm [32] = {
0xFFF0, 0xFFE0, 0xFFC0, 0xFF81, /* screen mask */
0xFF03, 0x0607, 0x000F, 0x001F,
0xC03F, 0xF07F, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0x0000, 0x0006, 0x000C, 0x0018, /* cursor mask */
0x0030, 0x0060, 0x70C0, 0x1D80,
0x0700, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000 };
/* Left arrow image */
static unsigned LArrIm [32] = {
0xFE1F, 0xF01F, 0x0000, 0x0000, /* screen mask */
0x0000, 0xF01F, 0xFE1F, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0x0000, 0x00C0, 0x07C0, 0x7FFE, /* cursor mask */
0x07C0, 0x00C0, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000 };
/* Cross image */
static unsigned crossIm [32] = {
0xFC3F, 0xFC3F, 0xFC3F, 0x0000, /* screen mask */
0x0000, 0x0000, 0xFC3F, 0xFC3F,
0xFC3F, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0x0000, 0x0180, 0x0180, 0x0180, /* cursor mask */
0x7FFE, 0x0180, 0x0180, 0x0180,
0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000 };
/* Pointing hand image */
static unsigned handIm [32] = {
0xE1FF, 0xE1FF, 0xE1FF, 0xE1FF, /* screen mask */
0xE1FF, 0xE000, 0xE000, 0xE000,
0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000,
0x1E00, 0x1200, 0x1200, 0x1200, /* cursor mask */
0x1200, 0x13FF, 0x1249, 0x1249,
0x1249, 0x9001, 0x9001, 0x9001,
0x8001, 0x8001, 0x8001, 0xFFFF };
static unsigned iBeamIm [32] = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, /* screen mask */
0XFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xF00F, 0x0C30, 0x0240, 0x0240, /* cursor mask */
0x0180, 0x0180, 0x0180, 0x0180,
0x0180, 0x0180, 0x0180, 0x0180,
0x0240, 0x0240, 0x0C30, 0xF00F };
/* Graphics cursor descriptors */
static GCURSREC check = {NULL, 6, 7};
static GCURSREC arrow = {NULL, 0, 3};
static GCURSREC cross = {NULL, 7, 4};
static GCURSREC hand = {NULL, 5, 0};
static GCURSREC iBeam = {NULL, 7, 7};
/* Global far pointer to mouse event record */
static EVENTREC far *theEvents;
/* --------------------------------------------------------------- */
void far handler (void) /* event handler called by device driver */
{
EVENTREC far *save; /* pointer to save area in diff segment */
unsigned a, b, c, d; /* temp storage of registers */
a = _AX, b = _BX, c = _CX, d = _DX; /* save registers */
save = MK_FP (_CS-0x10, 0x00C0); /* point to PSP user area */
save->flag = a; /* stuff registers into it */
save->button = b;
save->col = c;
save->row = d;
} /* ------------------------ */
void initGCurs (void) /* initialize ptrs in cursor descriptors */
{
check.image = checkIm;
arrow.image = LArrIm;
cross.image = crossIm;
hand.image = handIm;
iBeam.image = iBeamIm;
} /* ------------------------ */
/* End of GMOUSCUR.I */